import request from '@/pages/utils/request'


export function post1(data) {
	console.log("data","post1",data);
  return request.post('/course/getMainMenu', {}, {
    header: {
      'Content-Type': 'application/json'
    }
  })
}

export function getClazzCenter(data) {
  return request.post('/course/getClazzCenter', {}, {
    header: {
      'Content-Type': 'application/json'
    }
  })
}
export function isOrder(data) {
  return request.post('/usercourse/isOrder', data, {
    header: {
      'Content-Type': 'application/json'
    }
  })
}
//

export function getChapterPost(categoryId) {
  return request.post('/chapter/getChapter', { parentCategoryId:categoryId }, {
    headers: {
      'Content-Type': 'application/json'
    }
  })
}
// getChapterById

export function getChapterById(data) {

  console.log(data,"传入的参数");
  return request.post('/chapter/getChapterById', data, {
    headers: {
      'Content-Type': 'application/json'
    }
  })
}
// chapter/getVideos
export function getVideos(data) {
  console.log(data,"传入的参数");
  return request.post('/chapter/getVideos', data, {
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

// course/hot  获取热门课程
export function getHotCourses(data) { 
  console.log(data,"传入的参数");
  return request.post('/course/hot', data, {
    headers: {
      'Content-Type': 'application/json'
    }
  })
}



export function addCount(data) { 
  console.log(data,"传入的参数test");
   console.log(typeof data, data); // 确认类型和值
  return request.get(`/course/add?courseId=${data}`);
}

// export function isFree(data) { 
//   console.log(data,"传入的参数test");
   
//   return request.get(`/course/add?courseId=${data}`);
// }
